<template>
  <div id="app">
    <!-- 导航栏 -->
    <nav class="main-nav">
      <router-link to="/" class="nav-item" active-class="active">子应用首页</router-link>
      <router-link to="/page1" class="nav-item" active-class="active">页面一</router-link>
      <router-link to="/page2" class="nav-item" active-class="active">页面二</router-link>
    </nav>

    <!-- 主内容区 -->
    <main class="content-area">
      <router-view />
    </main>
  </div>
</template>

<script>
export default {
  name: 'App'
}
</script>

<style scoped>
#app {
  font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #333;
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 导航样式 */
.main-nav {
  display: flex;
  border-bottom: 1px solid #eee;
  padding: 0 20px;
}

.nav-item {
  padding: 18px 20px;
  color: #666;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item:hover {
  color: #2c3e50;
  background-color: #f8f9fa;
}

/* 激活状态样式 */
.nav-item.active {
  color: #2c3e50;
  font-weight: 500;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #42b983;
}

/* 内容区域样式 */
.content-area {
  padding: 30px 20px;
  min-height: 300px;
}

/* 响应式适配 */
@media (max-width: 600px) {
  .main-nav {
    flex-direction: column;
    padding: 0;
  }

  .nav-item {
    display: block;
    padding: 14px 20px;
  }

  .content-area {
    padding: 20px 15px;
    min-height: 300px;
  }
}
</style>
